package com.kcs.fxmargin.service;

import java.sql.Connection;
import java.util.List;

import com.kcs.common.utils.ConnectionUtils;
import com.kcs.common.utils.Constant;
import com.kcs.fxmargin.dao.RoleDao;
import com.kcs.fxmargin.model.MRole;

public class RoleService {

	public List<MRole> getRole() throws Exception{
		
		Connection conn 		= null;
		List<MRole> roleList	= null;
		RoleDao dao				= new RoleDao();
		
		try{
			conn 		= ConnectionUtils.getConnection(Constant.MSSQL, Constant.TO); // get connection fxmargin from mssql
			roleList	= dao.getRole(conn);
		} catch (Exception e){
			throw e;
		} finally {
			if(conn != null) conn.close();
		}
		
		return roleList;
	}
}
